function foundcells = findcells(animal, date, region, neuron)
cells = rawxlscells(animal);
if isempty(cells) % error mesage comes from rawxlscells
    foundcells = [];
    return
end

if length(date) > 0
    datefound = ismember(cells(:,2), date);
else
    datefound = true(size(cells,1),1);
end

if length(region) > 0
    regionfound = ismember(cells(:,3), region);
else
    regionfound = true(size(cells,1),1);
end

if neuron ~= 0
    neuronfound = ([cells{:,4}]== neuron)';
else
    neuronfound = true(size(cells,1),1);
end
found = find(neuronfound & regionfound & datefound);
foundcells = cells(found,1:6);
if isempty(found)
    foundcells = [];
    disp('findcells.m: No matching cells in Excel file found.')
end
